USE [OHNEW]
GO

/****** Object:  Table [dbo].[D_StorageInDetail]    Script Date: 12/03/2012 22:07:46 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[D_StorageInDetail](
	[ID] [uniqueidentifier] NOT NULL,
	[MainID] [uniqueidentifier] NOT NULL,
	[LineNumber] [int] NOT NULL,
	[PurchaseOrder] [uniqueidentifier] NULL,
	[Material] [uniqueidentifier] NOT NULL,
	[Batch] [uniqueidentifier] NULL,
	[Package] [uniqueidentifier] NULL,
	[Measure] [uniqueidentifier] NOT NULL,
	[Quantity] [decimal](18, 4) NOT NULL,
	[Price] [decimal](18, 2) NOT NULL,
	[Amount] [decimal](18, 2) NOT NULL,
 CONSTRAINT [PK_D_StorageInDetail] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [dbo].[D_StorageInDetail] ADD  CONSTRAINT [DF__D_StorageInDetail_ID]  DEFAULT (newid()) FOR [ID]
GO

ALTER TABLE [dbo].[D_StorageInDetail] ADD  CONSTRAINT [DF_D_StorageInDetail_Quantity]  DEFAULT ((0)) FOR [Quantity]
GO

ALTER TABLE [dbo].[D_StorageInDetail] ADD  CONSTRAINT [DF_D_StorageInDetail_Price]  DEFAULT ((0)) FOR [Price]
GO

ALTER TABLE [dbo].[D_StorageInDetail] ADD  CONSTRAINT [DF_D_StorageInDetail_Money]  DEFAULT ((0)) FOR [Amount]
GO


